package com.izliang.gateway.controller;

import com.alibaba.fastjson.JSONObject;
import com.izliang.gateway.client.goods.GoodsClient;
import model.Goods;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import res.Result;

@RestController
@RequestMapping(value = "/goods")
public class GoodsController {

    @Autowired
    private GoodsClient goodsClient;

    @RequestMapping(value = "/info")
    public JSONObject info(int id){
        Goods goods = goodsClient.getGoods(id);
        return Result.Result(200,"",goods);
    }


}
